﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace WindowsFormsApplication3
{
    public class AccDatBiblioteca
    {
        public SqlConnection ObtenerConexion(string rutaBD)
        {
            SqlConnection cn = new SqlConnection(rutaBD);
            try
            {
                cn.Open();
                return cn;
            }
            catch (Exception)
            {
                return null;
            }
        }

        public SqlDataAdapter ObtenerAdaptador(string ConsultaSQL, SqlConnection cn)
        {
            SqlDataAdapter adaptador;
            try
            {
                adaptador = new SqlDataAdapter(ConsultaSQL, cn);
                return adaptador;
            }
            catch (Exception)
            {
                return null;
            }
        }
    }
}
